
/* 导航栏样式 - 优化版本 */
.header {
    border-bottom:none;
    line-height:inherit;
    background-size:cover;
    position:relative;
    z-index:3;
    background: linear-gradient(to bottom,rgba(7,69,138,0.8),transparent);
    position:absolute;
    width:100%;
    top:0;
    transition:1s;
    height: 2.02rem;
    padding-top: 0.32rem;
    height: 168px;
}

.navbar {            
    position: fixed;
    width: 100%;
    height: 158px;
    /* background: rgba(255, 255, 255, 0.08); */
    backdrop-filter: blur(12px);
    border-radius: 0 0 68px 68px;
    padding: 1rem 2rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    top: 0;
    z-index: 2000;
    /* border-bottom: 1px solid rgba(255, 255, 255, 0.1); */
}

.nav-logo {
    display: flex;
    flex-shrink: 0;
    align-items: center;    
    min-width: 0;
    max-width: 25%; /* 限制logo部分宽度 */
}

.logo-text {
    display: flex;
    flex-shrink: 1;
    font-size: clamp(1rem, 2vw, 1.5rem);
    font-weight: 600;
    background: linear-gradient(to right, #74b9ff, #a29bfe);
    margin-left: 10px;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.menu-container{
    flex: 1 1 auto;
    display: flex;    
    justify-content: flex-end;
    min-width: 0;
    max-width: 80%; /* 为菜单分配更多空间 */
}

.nav-links {
    display: flex;
    flex: 1 1 auto;
    gap: 0.5rem;
    list-style: none;
    justify-content: flex-end;
    flex-wrap: wrap;
    max-width: 100%;
}

.nav-links a {
    font-size: clamp(0.8rem, 1.2vw, 1rem);
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 0.8rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    position: relative;
    white-space: nowrap;
    /* 确保文字完整显示 */
    overflow: visible;
    text-overflow: unset;
}

.nav-links a:hover {
    color: white;
    font-weight: 600;
    font-size: clamp(0.85rem, 1.3vw, 1.05rem);
    background: rgba(255, 255, 255, 0.1);
}

.nav-links a.selected {
    color: #74b9ff;
    background: rgba(255, 255, 255, 0.15);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #ff7ae5, #7a8aff);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

/* 响应式调整 */
@media (max-width: 1200px) {
    .nav-links a {
        padding: 0.5rem 0.6rem;
        font-size: clamp(0.75rem, 1.1vw, 0.95rem);
    }
}

@media (max-width: 1024px) {
    .navbar {
        padding: 1rem;
    }
    
    .nav-links {
        gap: 0.3rem;
    }
    
    .nav-links a {
        padding: 0.5rem 0.5rem;
        font-size: clamp(0.7rem, 1vw, 0.9rem);
    }
    
    .logo-text {
        font-size: clamp(0.9rem, 1.8vw, 1.3rem);
    }
}

@media (max-width: 900px) {
    .nav-logo {
        max-width: 25%;
    }
    
    .menu-container {
        max-width: 75%;
    }
    
    .nav-links a {
        padding: 0.4rem 0.4rem;
        font-size: clamp(0.65rem, 0.9vw, 0.85rem);
    }
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        height: auto;
        border-radius: 0 0 20px 20px;
        padding: 0.5rem 1rem;
    }
    
    .nav-logo {
        width: 100%;
        max-width: 100%;
        justify-content: center;
        margin-bottom: 0.5rem;
    }
    
    .menu-container {
        width: 100%;
        max-width: 100%;
    }
    
    .nav-links {
        justify-content: center;
        gap: 0.2rem;
    }
    
    .nav-links a {
        padding: 0.4rem 0.5rem;
        font-size: 0.8rem;
    }
    
    body {
        padding-top: 120px;
    }
}

@media (max-width: 480px) {
    .nav-links {
        flex-wrap: wrap;
    }
    
    .nav-links a {
        padding: 0.3rem 0.4rem;
        font-size: 0.75rem;
    }
    
    .logo-text {
        font-size: 1rem;
    }
}

/* 导航栏滚动动画效果 - 修复初始状态 */
.navbar {
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    /* 确保初始状态就有毛玻璃和圆角效果 */
    position: fixed;
    width: 100%;
    height: 158px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    border-radius: 0 0 68px 68px;
    padding: 1rem 2rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    top: 0;
    z-index: 2000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar.navbar-hidden {
    transform: translateY(-100%);
    opacity: 0;
}

.navbar.navbar-fixed {
    /* 保持固定定位，但调整圆角为更小的值 */
    border-radius: 0 0 24px 24px;
    /* 增强毛玻璃效果 */
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    animation: navbarReappear 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes navbarReappear {
    0% {
        transform: translateY(-100%);
        opacity: 0;
    }
    50% {
        transform: translateY(-30%);
        opacity: 0.5;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 页面滚动时的顶部间距调整 */
/* body.scrolled {
    padding-top: 160px;
} */
